var util = require('../../utils/util.js');
var ajax = require('../../utils/ajax.js');
var app = getApp();
Page({
    data: {
        dataLoaded: true,
        isClicked:false
    },
    onLoad(options) {},
    login: function(evt) {
        var _self = this;
        var {
            account,
            password
        } = evt.detail.value;
        var url = "/openapi/Shop/login";
        var paramsData = {
            account,
            password
        }
        this.setData({
            isClicked:true
        })
        ajax.P(url, paramsData, function(data) {
            var {
                shopSid
            } = data.result;
            app.setShopSid(shopSid);
            wx.redirectTo({
                url: '/pages/backstage/backstage'
            })
        })
        setTimeout(function(){
            _self.setData({
                isClicked:false
            })
        },3000)
    }
});